<template>
  <div class="index-honor sub-margin">
    <div class="sub-page-title">绩效榜</div>
    <div class="content">
      <div class="search-box">
        <el-menu
          size="small"
          :default-active="activeCode"
          class="search-menu-box"
          mode="horizontal"
          @select="onMenuClick">
          <el-menu-item v-for="(item, key) in menuInfo" :key="key" :index="key">
            {{ item.label }}
          </el-menu-item>
        </el-menu>
      </div>
      <div class="table-con">
        <PersonalPerformance v-if="activeCode === 'self'" />
        <MeritsHonor v-if="activeCode == 'all'" />
      </div>
    </div>
  </div>
</template>

<script>
import PersonalPerformance from './components/PersonalPerformance'
import MeritsHonor from './components/MeritsHonor'
export default {
  name: 'indexHonor',
  components: { PersonalPerformance, MeritsHonor },
  props: {},
  data() {
    return {
      menuInfo: {
        self: {
          label: '个人绩效',
          status: '0',
        },
        all: {
          label: '公示榜',
          status: '1',
        },
      },
      activeCode: 'all',
    }
  },
  watch: {},
  computed: {},
  created() {},
  mounted() {},
  methods: {
    onMenuClick(code) {
      this.activeCode = code
    },
  },
}
</script>
<style lang="scss" scoped>
@import '@styles/layout.scss';
.index-honor {
  height: 100%;
  .content {
    height: calc(100% - 78px);
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    .search-box {
      width: 100%;
      margin-bottom: 20px;
    }
    .table-con {
      flex: 1;
      display: flex;
      flex-direction: column;
    }
  }
}
</style>
